/* 全局样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 通用容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* 导航栏样式 */
nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 61px;
    z-index: 999;
}

nav ul {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    list-style: none;
}

nav ul li {
    margin-right: 10px;
}

nav ul li a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: #667eea;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

nav ul li a.active::after {
    width: 100%;
}

/* 主内容区域样式 */
main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    min-height: calc(100vh - 220px);
}

.content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.content-header h2 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.content-header h2::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 0;
    width: 50px;
    height: 3px;
    background: #667eea;
}

/* 登录页面样式 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-container h1 {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 28px;
}

/* 首页样式 */
.dashboard-content {
    text-align: center;
    padding: 60px 20px;
}

.dashboard-content h2 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 20px;
}

.dashboard-content p {
    color: #7f8c8d;
    font-size: 16px;
}

/* 按钮样式 */
.btn-add,
.btn-search,
.btn-reset,
.btn-submit,
.btn-cancel,
.btn-view,
.btn-edit,
.btn-delete,
.btn-back,
.btn-login {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-add::before,
.btn-search::before,
.btn-reset::before,
.btn-submit::before,
.btn-cancel::before,
.btn-view::before,
.btn-edit::before,
.btn-delete::before,
.btn-back::before,
.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: -1;
}

.btn-add:hover::before,
.btn-search:hover::before,
.btn-reset:hover::before,
.btn-submit:hover::before,
.btn-cancel:hover::before,
.btn-view:hover::before,
.btn-edit:hover::before,
.btn-delete:hover::before,
.btn-back:hover::before,
.btn-login:hover::before {
    left: 0;
}

.btn-add,
.btn-submit,
.btn-login {
    background: #667eea;
    color: white;
}

.btn-add:hover,
.btn-submit:hover,
.btn-login:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-search {
    background: #4caf50;
    color: white;
}

.btn-search:hover {
    background: #43a047;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.btn-reset,
.btn-cancel {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.btn-reset:hover,
.btn-cancel:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-view {
    background: #2196f3;
    color: white;
    padding: 8px 16px;
    margin-right: 8px;
    font-size: 13px;
}

.btn-view:hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-edit {
    background: #ff9800;
    color: white;
    padding: 8px 16px;
    margin-right: 8px;
    font-size: 13px;
}

.btn-edit:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.btn-delete {
    background: #f44336;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-delete:hover {
    background: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-back {
    background: #9e9e9e;
    color: white;
    padding: 10px 20px;
}

.btn-back:hover {
    background: #757575;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(158, 158, 158, 0.3);
}

/* 表单样式 */
.search-form,
.form-container {
    background: #f9f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
}

.search-form form,
.form-container form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.form-group {
    flex: 1;
    min-width: 240px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
}

.form-group label.required::after {
    content: ' *';
    color: #f44336;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    z-index: 1;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #667eea;
}

.form-group input.error,
.form-group select.error {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.form-actions {
    width: 100%;
    padding-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* 高级表单效果 */
.form-floating {
    position: relative;
}

.form-floating input,
.form-floating select {
    padding-top: 20px;
    height: auto;
}

.form-floating label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    background: white;
    padding: 0 4px;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.form-floating input:focus + label,
.form-floating input:not(:placeholder-shown) + label,
.form-floating select:focus + label,
.form-floating select:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: #667eea;
}

/* 表格样式 */
.employee-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.employee-table th,
.employee-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.employee-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #2c3e50;
    position: relative;
    user-select: none;
    cursor: pointer;
}

.employee-table th:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.employee-table tr:hover {
    background: #f8f9fa;
    transform: scale(1.005);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.employee-table .action-buttons {
    white-space: nowrap;
    display: flex;
    gap: 8px;
}

.employee-table .no-data {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px !important;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
}

.pagination a {
    padding: 10px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pagination span {
    color: #666;
    font-weight: 500;
}

/* 详情页面样式 */
.detail-container {
    max-width: 700px;
    margin: 0 auto;
    background: #f9f9fa;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateX(5px);
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-item label {
    width: 140px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    min-width: 140px;
    position: relative;
}

.detail-item label::after {
    content: ':';
    position: absolute;
    right: 15px;
    top: 0;
}

.detail-item span {
    flex: 1;
    color: #495057;
    font-size: 15px;
    padding-left: 20px;
}

.detail-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* 错误信息样式 */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.1);
    position: relative;
    overflow: hidden;
}

.error-message::before {
    content: '⚠️';
    margin-right: 8px;
}

/* 成功信息样式 */
.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
    position: relative;
    overflow: hidden;
}

.success-message::before {
    content: '✅';
    margin-right: 8px;
}

/* 404页面样式 */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 h2 {
    font-size: 72px;
    color: #667eea;
    margin-bottom: 20px;
    font-weight: 700;
}

.error-404 p {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    header {
        padding: 0;
    }

    nav {
        top: 120px;
    }

    .search-form form,
    .form-container form {
        flex-direction: column;
        align-items: stretch;
    }

    .form-group {
        min-width: 100%;
    }

    .employee-table {
        display: block;
        overflow-x: auto;
    }

    .login-container {
        margin: 50px 20px;
        padding: 30px 20px;
    }

    nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .detail-item {
        flex-direction: column;
        gap: 8px;
    }

    .detail-item label {
        min-width: 100%;
    }

    .detail-item label::after {
        display: none;
    }

    .detail-item span {
        padding-left: 0;
    }

    .content {
        padding: 20px;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.content-header h2 {
    animation: pulse 2s ease-in-out infinite;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: rgba(51, 51, 51, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 12px;
    backdrop-filter: blur(5px);
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    transform: translateY(-5px);
}

/* 加载状态 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}